<?php
class Peta extends CI_Controller {

	function __construct()
	{
		parent::__construct();	
		$this->load->library('form_validation');
		$this->load->library('googlemaps');
		//$this->load->library('url');
		$this->load->model('jalan_model');
		$this->load->model('rasio_vc_model');
	}
	
	function index()
	{
		
		$config['trafficOverlay']=TRUE;
		$config['zoom']= 'auto';
		$config['center']='-7.447405900000001, 112.71856070000001';
		
		$this->googlemaps->initialize($config);
		
		
		
		$data_jalan=$this->jalan_model->get_jalan_pagi();
		//$data_vc=$this->rasio_vc_model->get_rasio();
		
		foreach($data_jalan as $data_jalan){
			$rasio=site_url('rasio/rasio/'.$data_jalan->IDPEMOHON.'');
			$repo=site_url('file_pdf/file_pdf/'.$data_jalan->IDPEMOHON.'');
			$marker=array();
			$marker['position']= $data_jalan->LATITUDE.",".$data_jalan->LONGITUDE ;
			$marker['infowindow_content']="<?php <html><head></head><body><h5>Nama Pemohon  : ".$data_jalan->NAMA_PEMOHON."</h5></br><h5>Jalan  : ".$data_jalan->JALAN."</h5></br><h5>Kelurahan  : ".$data_jalan->KELURAHAN."</h5></br><h5>Peruntukan  : ".$data_jalan->PERUNTUKAN."</h5></br><h5>Luas  : ".$data_jalan->LUAS."</h5></br><h5>  <a href='".$rasio."'>Lihat Rasio</a>  &nbsp;   <a href='".$repo."'>Lihat Arsip</a> </h5> </html>";
			$marker['title'] = $data_jalan->JALAN;
			$marker['animation']="DROP";
			$marker['icon']= base_url().'/images/highwayq.png';	
			$this->googlemaps->add_marker($marker);
		}
		$data['ket_rasio']='Peta lokasi pemohon secara keseluruhan';
		$data['waktu']='Peta V/C Pagi';
		$data['map']=$this->googlemaps->create_map();
		$data['content'] = $this->load->view('map/map_rasio',$data,true);
		$this->load->view('main',$data);
		
	}
	
	
	
	 
}
?>
